package com.suneast.suneaststore.modules.sort.adapter;

import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suneast.suneaststore.R;
import com.suneast.suneaststore.bean.sort.SubCate;

import java.util.ArrayList;

/**
 * Created by zestz on 2018/3/7.
 */

public class SortItemAdapter extends BaseQuickAdapter<SubCate, SortItemAdapter.ViewHolder> {

    public SortItemAdapter(int layoutId, ArrayList<SubCate> data) {
        super(layoutId, data);
    }

    @Override
    protected void convert(ViewHolder helper, SubCate item) {
        helper.setText(R.id.tv_item_category_name, item.getName());
        Glide.with(helper.itemView.getContext()).load(item.getThumb())
                .into((ImageView) helper.getView(R.id.item_img));
    }

    public static class ViewHolder extends BaseViewHolder {
        public ViewHolder(View itemView) {
            super(itemView);
        }
    }
}
